#!/usr/bin python3
# -*- coding: utf-8 -*-
"""  任务执行信息表   """
from sqlalchemy import Column, String, Date
from gtm_server.common.database_pg import Base


class TaskManagerModel(Base):
    """
    任务执行信息表定义
    """
    __tablename__ = "task_manager"

    id = Column("id", String(255), primary_key=True)
    task_id = Column("task_id", String(255))
    user_id = Column("user_id", String(255))
    duration = Column("duration", int(4))
    coin_rate = Column("coin_rate", int(4))
    status = Column("status", String(255))
    exe_time = Column("exe_time", Date(8))
    finsh_time = Column("finsh_time", Date(8))

    def __init__(self, id, task_id, user_id, duration, coin_rate, status, exe_time, finsh_time):
        self.id = id
        self.task_id = task_id
        self.user_id = user_id
        self.duration = duration
        self.coin_rate = coin_rate
        self.status = status
        self.exe_time = exe_time
        self.finsh_time = finsh_time
